package com.fz.us.admin.company.entity;

import com.fz.us.admin.base.entity.BaseEntity;
import com.fz.us.admin.company.bean.EnumManage;

import javax.persistence.*;
import java.util.Date;

/**
 * 实体类 - 动态
 * ============================================================================
 * 版权所有 2015 。
 *
 * @author qiushihua
 *
 * @version 1.0 2015-09-16
 * ============================================================================
 */
@javax.persistence.Entity
@Table(name="ss_active")
public class Active extends CompanyEntity {

    private static final long serialVersionUID = -155237502754081997L;

    /**
     * 发送者（创建者）
     */
    private User sender;
    /**
     * 创建时间
     */
    private Date sendDate;
    /**
     * 接收者
     */
    private String receiver;
    /**
     * 动态类别（来源）
     */
    private EnumManage.ActiveTypeEnum type;
    /**
     * 动态类型（操作）
     */
    private EnumManage.ActiveModelEnum model;

    /**
     * 目标对象
     */
    private String targetId;
    private String targetClass;

    /**
     * 操作
     * 履历（0创建 & 1修改 & 2通知）
     * 批注（0批注 & 1回复）
     * 代办（0待审批 & 1审批）
     */
    private int objectType;

    /**
     * 内容
     */
    private EnumManage.CommentModelEnum objectModel;
    private String objectText;
    private String objectFileId;
    private String objectLocationId;

    /**
     * 回复内容
     */
    private User replyUser;
    private String replyText;

    /**
     * 已读（0|1）
     */
    private int isRead;
    private Date readDate;

    @ManyToOne(fetch = FetchType.LAZY)
    public User getSender() {
        return sender;
    }
    public void setSender(User sender) {
        this.sender = sender;
    }

    public Date getSendDate() {
        return sendDate;
    }
    public void setSendDate(Date sendDate) {
        this.sendDate = sendDate;
    }

    public String getReceiver() {
        return receiver;
    }

    public void setReceiver(String receiver) {
        this.receiver = receiver;
    }

    @Column(nullable = false)
    @Enumerated(EnumType.STRING)
    public EnumManage.ActiveTypeEnum getType() {
        return type;
    }
    public void setType(EnumManage.ActiveTypeEnum type) {
        this.type = type;
    }

    @Column(nullable = false)
    @Enumerated(EnumType.STRING)
    public EnumManage.ActiveModelEnum getModel() {
        return model;
    }
    public void setModel(EnumManage.ActiveModelEnum model) {
        this.model = model;
    }

    public String getTargetId() {
        return targetId;
    }
    public void setTargetId(String targetId) {
        this.targetId = targetId;
    }

    public String getTargetClass() {
        return targetClass;
    }
    public void setTargetClass(String targetClass) {
        this.targetClass = targetClass;
    }

    public int getObjectType() {
        return objectType;
    }
    public void setObjectType(int objectType) {
        this.objectType = objectType;
    }

    @Column(nullable = false)
    @Enumerated(EnumType.STRING)
    public EnumManage.CommentModelEnum getObjectModel() {
        return objectModel;
    }
    public void setObjectModel(EnumManage.CommentModelEnum objectModel) {
        this.objectModel = objectModel;
    }

    @Column(length = 65535)
    public String getObjectText() {
        return objectText;
    }
    public void setObjectText(String objectText) {
        this.objectText = objectText;
    }

    public String getObjectFileId() {
        return objectFileId;
    }
    public void setObjectFileId(String objectFileId) {
        this.objectFileId = objectFileId;
    }

    public String getObjectLocationId() {
        return objectLocationId;
    }
    public void setObjectLocationId(String objectLocationId) {
        this.objectLocationId = objectLocationId;
    }

    @ManyToOne(fetch = FetchType.LAZY)
    public User getReplyUser() {
        return replyUser;
    }
    public void setReplyUser(User replyUser) {
        this.replyUser = replyUser;
    }

    @Column(length = 65535)
    public String getReplyText() {
        return replyText;
    }
    public void setReplyText(String replyText) {
        this.replyText = replyText;
    }

    public int getIsRead() {
        return isRead;
    }
    public void setIsRead(int isRead) {
        this.isRead = isRead;
    }

    public Date getReadDate() {
        return readDate;
    }
    public void setReadDate(Date readDate) {
        this.readDate = readDate;
    }

}
